package com.crr.bean;

import io.swagger.annotations.ApiModel;

/**
 * 分页查询条件基础类
 */
@ApiModel("分页条件类")
public class PageBean {
    private final int DEFAULT_PAGE=1;
    private final int DEFAULT_PAGE_SIZE=10;
   int page;
   int pagerSize;


    public int getPage() {
        if(this.page==0){
            return DEFAULT_PAGE;
        }
      return page;
    }

    public void setPage(int page) {
        if(page<=0){
            this.page=DEFAULT_PAGE;
        }else {
            this.page = page;
        }

    }

    public int getPagerSize() {
        if(this.pagerSize==0){
            return DEFAULT_PAGE_SIZE;
        }
        return pagerSize;
    }

    public void setPagerSize(int pagerSize) {
        if(pagerSize<=0){
            this.pagerSize=DEFAULT_PAGE_SIZE;
        }else{
            this.pagerSize = pagerSize;
        }

    }
}
